package com.king.designpatterns.创造型模式.单例模式;

/**
 * 饿汉式单例类
 *
 * @author king
 * @date 2021-06-04 23:57
 */
public class HungryChineseSingleton {
    private static HungryChineseSingleton m_instance = new HungryChineseSingleton();

    // 构造方法私有，保证外界无法直接实例化
    private HungryChineseSingleton(){}

    // 通过该方法获得实例对象
    public static HungryChineseSingleton getInstance(){
        return m_instance;
    }
}
